<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.io.BufferedReader,java.io.FileNotFoundException,java.io.FileReader,java.io.IOException" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TFIS v1.0</title>
<meta name="description" content="Transcription Factor Information System">
<meta name="keywords" content="TFIS, TF, TFBS">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>

<div id="wrapper"> 

  <div id="header"> 

    <div class="top_banner">
      <h1>TFIS v1.0</h1>
      <p>Transcription Factor Information System</p>
    </div>
 
  </div>

  <div id="page_content">

    <div class="navigation">
      <ul>
        <li><a href="index.jsp">Home</a></li>
        <li><a href="about.jsp">About</a></li>
        <li><a href="doc.jsp">Documentation</a></li>
        <li><a href="feedback.jsp">Feedback</a></li>
        <li><a href="support.jsp">Support</a></li>
      </ul>
    </div>

    <div class="main_section">
      <h2>TFIS v1.0 : Position Weight Matrix Single Transcription Factor Scan</h2>
      <hr>
      <div class="common_content">
        
		<form id="form" action="PWMSingleScan" method="post">  
  
		Gene Sequence:<br><textarea rows="25" cols="120" name="userSequence"></textarea><br><br>  
		Percent Score:<select name="percent">
		<option value="85">85%</option>
		<%
  		for(int i = 5; i <= 100; i = i + 5){
	  		out.println("<option value='"+i+"'>"+i+"%</option>");
  		}
  		%>
		</select>
  		Transcription Factor (TF):<input type="text" name="transcriptionFactor" list="tflist">
      	<datalist id="tflist">
   		<%       
       	String line;
        String name;
        FileReader fr=new FileReader("pfm/pfm_all.txt");
        BufferedReader br = new BufferedReader(fr);
                while ((line = br.readLine()) != null) {
                    if(line.startsWith(">")){
                        String delimiters = "[> ]";
                        String[] tokens = line.split(delimiters);
                        name=tokens[2];
                        out.println("<option value='"+name+"'>");
                    }
                
                } 
                br.close();
    	%>      
      	</datalist><br><br>  
 
 		<center>
 		<div id="loading" style="display:none;"><img src="images/loading.gif" alt="" /></div>
 		<input id="submit" value="Scan" type="submit"/>  
 		</center>
  
       <script type="text/javascript">
		(function (d) {
  			d.getElementById('form').onsubmit = function () {
    			d.getElementById('submit').style.display = 'none';
    			d.getElementById('loading').style.display = 'block';
  			};
		}(document));
		</script>
					  
		</form>
       
      </div>
      
    </div>

    <div id="footer">Sengupta <i>et al.</i> | Developed and Maintained by <a href="http://www.abhishekduhoon.com" target="_blank">Abhishek Kumar</a>.
 	</div>

 </div>
 
</div>

</body>
</html>

